﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="PhienChotDau.aspx.cs" Inherits="PhienChotDau" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Thông tin phiên chốt dầu</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            <td width="25%">
                                <span style="margin-left: 5px;">Biển số xe</span><br />
                                <asp:DropDownList ID="drbiensoxe" DataValueField="IDs" DataTextField="DoiTuongChi"
                                    runat="server" CssClass="form-control with98">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="drbiensoxe" ErrorMessage="Chọn biển số xe" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="25%">
                                Số nhiên liệu<br />
                                <asp:TextBox ID="txtsonhienlieu" runat="server" CssClass="form-control witha98"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator4" runat="server"
                                    ControlToValidate="txtsonhienlieu" ErrorMessage="Nhập số nhiên liệu" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtsonhienlieu" ValidChars=",." />
                            </td>
                            <td width="25%">
                                <span style="margin-left: 5px;">Số km chốt</span><br />
                                <asp:TextBox ID="txtsokm" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                                    ControlToValidate="txtsokm" ErrorMessage="Nhập số KM chốt" Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtsokm" ValidChars=",." />
                            </td>
                            <td>
                                Ngày nạp<br />
                                <asp:TextBox ID="txtngaynap" runat="server" CssClass="form-control withall"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator3" runat="server"
                                    ControlToValidate="txtngaynap" ErrorMessage="Nhập ngày nạp" Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:CalendarExtender PopupPosition="BottomLeft" ID="CalendarExtender2" runat="server"
                                    TargetControlID="txtngaynap" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtngaynap" ValidChars="/-" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                                    Text="Lưu lại" CssClass="btn btn-primary" OnClick="btnSave_Click" />
                                <asp:Button ID="btncapnhat" runat="server" Text="Cập nhật" CssClass="btn btn-info"
                                    OnClick="btncapnhat_Click" Visible="false" />
                                <asp:Button ID="btnCancel" runat="server" Text="Nhập mới" CssClass="btn btn-warning"
                                    OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                </div>
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <b>Danh sách phiên chốt dầu</b>
                    </div>
                    <div style="width: 100%; margin-top: 0px;" class="wrapper">
                        
                        <asp:DropDownList ID="dlThang" AutoPostBack="true" runat="server" Width="150px" 
                            CssClass="form-control" onselectedindexchanged="dlThang_SelectedIndexChanged">
                            <asp:ListItem Text="Theo thời gian" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Tháng 1" Value="1"></asp:ListItem>
                            <asp:ListItem Text="Tháng 2" Value="2"></asp:ListItem>
                            <asp:ListItem Text="Tháng 3" Value="3"></asp:ListItem>
                            <asp:ListItem Text="Tháng 4" Value="4"></asp:ListItem>
                            <asp:ListItem Text="Tháng 5" Value="5"></asp:ListItem>
                            <asp:ListItem Text="Tháng 6" Value="6"></asp:ListItem>
                            <asp:ListItem Text="Tháng 7" Value="7"></asp:ListItem>
                            <asp:ListItem Text="Tháng 8" Value="8"></asp:ListItem>
                            <asp:ListItem Text="Tháng 9" Value="9"></asp:ListItem>
                            <asp:ListItem Text="Tháng 10" Value="10"></asp:ListItem>
                            <asp:ListItem Text="Tháng 11" Value="11"></asp:ListItem>
                            <asp:ListItem Text="Tháng 12" Value="12"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlNam" runat="server" Width="140px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:TextBox ID="txtTuNgay" runat="server" placeholder="Từ ngày" Visible="true"  Width="100px" CssClass="form-control"></asp:TextBox>&nbsp;
                        <asp:TextBox ID="txtDenNgay" runat="server" placeholder="Đến ngày" Visible="true"
                             Width="100px" CssClass="form-control"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtTuNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDenNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtTuNgay" ValidChars="/-" />
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtDenNgay" ValidChars="/-" />
                        <asp:DropDownList ID="dlLocBienSo" runat="server" DataValueField="IDs" Width="250px" CssClass="form-control"
                            DataTextField="DoiTuongChi">
                        </asp:DropDownList>
                        <asp:Button ID="btnXem" CssClass="btn btn-warning" runat="server" Text="Xem dữ liệu"
                            OnClick="btnXem_Click" />
                        <br />
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" CssClass="form-control withall" ShowFooter="true"
                            Width="99%" OnRowCommand="GV_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Xóa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/img/delete-24.png"
                                            OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("IDs")%>'
                                            Text="Xóa" CommandName="Del" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbSua" runat="server" Width="15px" Height="15px" ImageUrl="~/img/edit.ico"
                                            CommandArgument='<%#Eval("IDs")%>' Text="Sửa" CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="biensoxe" ItemStyle-CssClass="padding" HeaderText="Biển số xe"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="laixe" ItemStyle-CssClass="padding" HeaderText="Lái xe"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="SoNhienLieu" ItemStyle-CssClass="padding" HeaderText="Số nhiên liệu"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="Sokm" ItemStyle-CssClass="padding" HeaderText="Số chốt km"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="DinhMuc" DataFormatString="{0:N3}" ItemStyle-CssClass="padding"
                                    HeaderText="Định mức" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="Ngaynap" ItemStyle-CssClass="padding" HeaderText="Ngày nạp"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="giacovat" DataFormatString="{0:0,0}" ItemStyle-CssClass="padding"
                                    HeaderText="Đơn giá VAT" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="giakhongvat" DataFormatString="{0:0,0}" ItemStyle-CssClass="padding"
                                    HeaderText="Đơn giá không VAT" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="thanhtienvat" DataFormatString="{0:0,0}" ItemStyle-CssClass="padding"
                                    HeaderText="Thành tiền có VAT" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="thanhtienkhongvat" DataFormatString="{0:0,0}" ItemStyle-CssClass="padding"
                                    HeaderText="Thành tiền không VAT" HeaderStyle-HorizontalAlign="Center"
                                    ItemStyle-HorizontalAlign="Right" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Right" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <div style="margin: 5px;">
                            <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                            <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                                OnClick="btnPre_Click" />
                            <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                                OnClick="btnNext_Click" />
                        </div>
                    </div>
                </div>
                <asp:HiddenField ID="hdID" runat="server" />
                <asp:HiddenField ID="hdDenNgay" runat="server" />
                <asp:HiddenField ID="hdTuNgay" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
